package com.eu.ebpm.engine.entity.enumm;

/**
 * @author 王晓华
 *
 */
public enum TaskStatus {

	EXEING("执行中", 1),

	SUCCESS("成功", 2);

	private String description;

	private int code;

	TaskStatus(String description, int code) {
		this.description = description;
		this.code = code;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public static TaskStatus getByCode(Integer code) {

		TaskStatus[] codes = TaskStatus.values();
		
		for (TaskStatus assetProductTypeEnum : codes) {
			if (assetProductTypeEnum.code == code.intValue()) {
				return assetProductTypeEnum;
			}
		}
		
		return null;
	}

}
